package com.insider.service.impl;


import com.insider.dao.UserDao;
import com.insider.domain.User;
import com.insider.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.sql.SQLException;

@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public void save(User user) throws SQLException {
        userDao.save(user);
    }

    @Override
    public User find(Integer userId) throws SQLException {
        return userDao.find(userId);
    }

    @Override
    public void update(User user) throws SQLException {
        userDao.update(user);
    }

    @Override
    public void delete(User user) throws SQLException {
        userDao.delete(user);
    }
}
